atspi: Give model buttons a click action too
authorMatthias Clasen <mclasen@redhat.com>
Wed, 21 Oct 2020 23:13:03 +0000 (19:13 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 22 Oct 2020 01:27:38 +0000 (21:27 -0400)
GtkModelButton is no longer derived from GtkButton,
but can still treat it like a button for the purposes
of having a click action. This lets ATs activate
menu items again.

gtk/a11y/gtkatspiaction.c

index 2c28c0fbbd2cf4f1b833aa1912739f33fad12182..42392a00f3f086314b23f09a9ae021aeb332f4dc 100644 (file)
@@ -32,6 +32,7 @@
 #include "gtkbutton.h"
 #include "gtkentryprivate.h"
 #include "gtkexpander.h"
+#include "gtkmodelbuttonprivate.h"
 #include "gtkpasswordentryprivate.h"
 #include "gtkswitch.h"
 #include "gtkwidgetprivate.h"
@@ -810,7 +811,8 @@ static const GDBusInterfaceVTable widget_action_vtable = {
 const GDBusInterfaceVTable *
 gtk_atspi_get_action_vtable (GtkAccessible *accessible)
 {
-  if (GTK_IS_BUTTON (accessible))
+  if (GTK_IS_BUTTON (accessible) ||
+      GTK_IS_MODEL_BUTTON (accessible))
     return &button_action_vtable;
   else if (GTK_IS_ENTRY (accessible))
     return &entry_action_vtable;